Crate kas_view

source ·
Expand description

View widgets and shared data

View widgets allow data-oriented design. This is vaguely similar to the Model-View-Controller pattern or Elm’s Model-View-Update design, but with no direct link between Model and Controller:

  1. Model traits describe data models: ListData, MatrixData
  2. Drivers describe how to build a widget view over data and (optionally) how to handle messages from view widgets
  3. Controllers are special widgets which manage views over data

Three controllers are provided by this crate:

  • ListView constructs a row or column of views over indexable data
  • MatrixView constructs a table/sheet of views over two-dimensional indexable data

Both ListView and MatrixView support virtual scrolling: the number of view widget instances is limited (approximately) to the number required to cover the visible area, and these are re-used to enable fast scrolling through large data sets.

Re-exports

Modules

Structs

  • View controller for 1D indexable data (list)
  • View controller for 2D indexable data (matrix)

Enums

Traits